// $Id: RenditionsPage.java 11 2011-09-08 21:03:19Z huijzer@gmail.com $
package lime.browser.editor;

import lime.Activator;
import lime.model.Document;

import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.plugin.AbstractUIPlugin;

public class RenditionsPage extends FormPage {

	private RenditionsBlock block;
	
	public RenditionsPage(FormEditor editor) {
		super(editor, "renditions", "Renditions");
		
		DocumentInput input = (DocumentInput) editor.getEditorInput();
		Document document = input.getDocument();		
		
		block = new RenditionsBlock(document);
	}
	
	@Override
	protected void createFormContent(IManagedForm managedForm) {
	
		FormToolkit toolkit = managedForm.getToolkit();
		ScrolledForm scrolledForm = managedForm.getForm();
		scrolledForm.setText("Renditions");
		Image image = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/document-convert.png").createImage(); 
		scrolledForm.setImage(image);
		toolkit.decorateFormHeading(scrolledForm.getForm());

		block.createContent(managedForm);
	}
	
}
